cmake_minimum_required(VERSION 3.5) 
# 项目名称
project(ex_st)  

# c++版本为c++11，
set(CMAKE_CXX_STANDARD 11)
# 编译类型:Debug(调试), Release(发布)
set(CMAKE_BUILD_TYPE RELEASE)                               
# C++编译选项(优化程度为-O3)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -w -O3 -g")    

# 寻找realsense2库
find_package(realsense2 REQUIRED)
# 寻找OpenCV库
find_package(OpenCV REQUIRED)

# 头文件所在的目录
include_directories(${CMAKE_SOURCE_DIR}/include)
include_directories( ${OpenCV_INCLUDE_DIRS} )

# 所有的源文件路径
file(GLOB_RECURSE sources ${CMAKE_SOURCE_DIR}/src/*.cpp)

# 可执行文件包含的源文件
add_executable(ex_st ex_st.cpp ${sources})

# 链接第三方库
target_link_libraries(${PROJECT_NAME} ${realsense2_LIBRARY})
target_link_libraries(${PROJECT_NAME} ${OpenCV_LIBS})
